package com.ruoyi.system.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.system.mapper.SysCopyrightMapper;
import com.ruoyi.system.domain.SysCopyright;
import com.ruoyi.system.service.ISysCopyrightService;

/**
 * 版权信息Service业务层处理
 * 
 * @author ruoyi
 * @date 2022-04-06
 */
@Service
public class SysCopyrightServiceImpl implements ISysCopyrightService 
{
    @Autowired
    private SysCopyrightMapper sysCopyrightMapper;

    /**
     * 查询版权信息
     * 
     * @param copyrightId 版权信息主键
     * @return 版权信息
     */
    @Override
    public SysCopyright selectSysCopyrightByCopyrightId(Long copyrightId)
    {
        return sysCopyrightMapper.selectSysCopyrightByCopyrightId(copyrightId);
    }

    /**
     * 查询版权信息列表
     * 
     * @param sysCopyright 版权信息
     * @return 版权信息
     */
    @Override
    public List<SysCopyright> selectSysCopyrightList(SysCopyright sysCopyright)
    {
        return sysCopyrightMapper.selectSysCopyrightList(sysCopyright);
    }

    /**
     * 新增版权信息
     * 
     * @param sysCopyright 版权信息
     * @return 结果
     */
    @Override
    public int insertSysCopyright(SysCopyright sysCopyright)
    {
        sysCopyright.setCreateTime(DateUtils.getNowDate());
        return sysCopyrightMapper.insertSysCopyright(sysCopyright);
    }

    /**
     * 修改版权信息
     * 
     * @param sysCopyright 版权信息
     * @return 结果
     */
    @Override
    public int updateSysCopyright(SysCopyright sysCopyright)
    {
        sysCopyright.setUpdateTime(DateUtils.getNowDate());
        return sysCopyrightMapper.updateSysCopyright(sysCopyright);
    }

    /**
     * 批量删除版权信息
     * 
     * @param copyrightIds 需要删除的版权信息主键
     * @return 结果
     */
    @Override
    public int deleteSysCopyrightByCopyrightIds(Long[] copyrightIds)
    {
        return sysCopyrightMapper.deleteSysCopyrightByCopyrightIds(copyrightIds);
    }

    /**
     * 删除版权信息信息
     * 
     * @param copyrightId 版权信息主键
     * @return 结果
     */
    @Override
    public int deleteSysCopyrightByCopyrightId(Long copyrightId)
    {
        return sysCopyrightMapper.deleteSysCopyrightByCopyrightId(copyrightId);
    }

    @Override
    public SysCopyright getCopyrightInfo() {
        return sysCopyrightMapper.getCopyrightInfo();
    }
}
